// 权限管理
import { ajaxService } from '@/utils/request';

const env = import.meta.env;
const baseURL = env.VITE_APP_BASE_URL;

// 获取菜单列表
export function getMenuList(params: any) {
  return ajaxService({
    url: '/platform_management/auth_center/menu/list',
    method: 'get',
    baseURL,
    params
  });
}

// 获取菜单列表
export function getMenuPageList(params: any) {
  return ajaxService({
    url: '/platform_management/auth_center/menu/page',
    method: 'get',
    baseURL,
    params
  });
}

// 获取菜单列表
export function getMenuParameterDuplicationCheck(params: any) {
  return ajaxService({
    url: '/platform_management/auth_center/menu/parameter/duplication/check',
    method: 'get',
    baseURL,
    params
  });
}

// 新增菜单
export function postMenuList(data: any) {
  return ajaxService({
    url: '/platform_management/auth_center/menu',
    method: 'post',
    baseURL,
    data
  });
}

// 删除菜单
export function delMenu(params: any) {
  return ajaxService({
    url: '/platform_management/auth_center/menu',
    method: 'delete',
    baseURL,
    params
  });
}

// 修改菜单
export function putMenuList(data: any) {
  return ajaxService({
    url: '/platform_management/auth_center/menu',
    method: 'put',
    baseURL,
    data
  });
}
